<?php
/**
 * Copyright (c) 2016.  hangzhou BOYE .Co.Ltd. All rights reserved
 */

/**
 * Created by PhpStorm.
 * User: 1
 * Date: 2016-12-19
 * Time: 18:39
 */

namespace app\admin\controller;



use app\src\atf\logic\AtfLogicV2;


class Atf extends Admin
{

    public function index() {

        $tel   = $this->_param('tel', '');
        $name = $this->_param('name', '');

        $params = [];
        $map    = null;
        if(!empty($mobile)){
            $map['tel'] = array('like', "%" . $mobile  . "%");
            $params['tel'] = $mobile;
        }
        if(!empty($name)){
            $map['name'] = array('like', "%" . $name  . "%");
            $params['name'] = $name;
        }

        $p = $this->_param('p',0);
        $page = array('curpage' => $p, 'size' => 10);
        $order = "id desc ";
        $result = (new AtfLogicV2())->queryWithPagingHtml($map, $page, $order,$params);
        if ($result) {
            $params['p'] = $p;
            $this -> assign('params',$params);
            $this -> assign('tel',$tel);
            $this -> assign("name",$name);
            $this -> assign("show", $result['show']);
            $this -> assign("list", $result['list']);
            return $this -> boye_display();
        } else {
            $this -> error($result);
        }
    }



}